package com.yuju.account.enums;

import com.yuju.account.enums.SettleAccountReturnCodeEnum;

public enum UnitAccountBookReturnCodeEnum {
	
	UNITACCOUNTBOOK_SAVE_SUCCESS("yuju-UnitAccountBook-1001", "新增帐套成功"),
	UNITACCOUNTBOOK_SAVE_FAILURE("yuju-UnitAccountBook-1002", "新增帐套失败"),
	UNITACCOUNTBOOK_UPDATE_SUCCESS("yuju-UnitAccountBook-1003", "更新帐套成功"),
	UNITACCOUNTBOOK_UPDATE_FAILURE("yuju-UnitAccountBook-1004", "更新帐套失败"),
	UNITACCOUNTBOOK_LIST_SUCCESS("yuju-UnitAccountBook-1005", "帐套列表查询成功"),
	UNITACCOUNTBOOK_LIST_FAILURE("yuju-UnitAccountBook-1006", "帐套列表查询失败"),
	UNITACCOUNTBOOK_NOTHING("yuju-UnitAccountBook-1007", "无数据"),
	UNITACCOUNTBOOK_REDUCE_SUCCESS("yuju-UnitAccountBook-1008", "帐套取消结账成功"),
	UNITACCOUNTBOOK_REDUCE_FAILURE("yuju-UnitAccountBook-1009", "帐套取消结账失败");
	
	private String code;
	private String desc;
	
	UnitAccountBookReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (SettleAccountReturnCodeEnum enume : SettleAccountReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
